﻿@model ConsentViewModel

<div class="page-consent">
    <div class="consent-card mdl-card mdl-shadow--2dp">
        <img class="head-logo" src="https://res.cngal.org/_content/CnGalWebSite.Shared/images/head_logo_6th.png">
        <div class="mdl-card__title app-name">
            <img src="@Model.ClientLogoUrl">
            <h1> @(string.IsNullOrWhiteSpace(Model.ClientName)?"待审核应用": Model.ClientName)) <small class="text-muted">正在请求你的授权</small></h1>
        </div>
        <div class="mdl-card__supporting-text text-center">
            取消勾选你不希望授权的项目
        </div>
        <partial name="_ValidationSummary" />


        <div class="mdl-card__supporting-text">
            <form asp-action="Index">
                <input type="hidden" asp-for="ReturnUrl" />

                @if (Model.IdentityScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <div class="card-header">
                                个人信息
                            </div>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.IdentityScopes)
                                {
                                    <partial name="_ScopeListItem" model="@scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                @if (Model.ApiScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <div class="card-header">
                                应用权限
                            </div>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.ApiScopes)
                                {
                                    <partial name="_ScopeListItem" model="scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                @if (Model.AllowRememberConsent)
                {
                    <div class="remeber">
                            <input class="form-check-input" asp-for="RememberConsent">
                            <label class="form-check-label" asp-for="RememberConsent">
                                <strong>记住我的选择</strong>
                            </label>
                    </div>
                }

                <div class="action">
                    <button name="button" value="yes" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">同意</button>
                    <button name="button" value="no" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">拒绝</button>

                </div>
            </form>
        </div>
        <div class="mdl-card__supporting-text text-center">
            @if (Model.ClientUrl != null)
            {
                <a class="btn btn-outline-info" target="_blank" href="@Model.ClientUrl">
                    @Model.ClientName
                </a>
            }
        </div>

    </div>
</div>
